package com.day17me.java;

import java.util.LinkedList;

public class LinkedListTest {
    public static void main(String[] args) {
        LinkedList list = new LinkedList();
        list.add("Mary");
        list.add("Tom");
        list.add("July");
        list.add("Jerry");
        System.out.println(list);

        list.addFirst("苹果");
        list.addLast("香蕉");
        System.out.println(list);

        String s = (String)list.get(3);
        System.out.println(s);
        String s1 = (String)list.getFirst();
        System.out.println(s1);
        String s2 = (String)list.getLast();
        System.out.println(s2);

        list.remove("Tom");
        list.remove(1);

    }
}
